﻿using System;

namespace SwissTransTracker
{
    /// <summary>
    ///     See transport.opendata.ch
    /// </summary>
    public class Connection
    {
        /// <summary>
        ///     The departure  checkpoint of the connection
        /// </summary>
        public Checkpoint From { get; set; }

        /// <summary>
        ///     The arrival  checkpoint of the connection
        /// </summary>
        public Checkpoint To { get; set; }

        /// <summary>
        ///     Duration of the journey
        /// </summary>
        public TimeSpan? Duration { get; set; }

        /// <summary>
        ///     Service information about how regular the connection operates
        /// </summary>
        public Service Service { get; set; }

        /// <summary>
        ///     Array with transport products
        /// </summary>
        public string[] Products { get; set; }

        /// <summary>
        ///     The maximum estimated occupation load of 1st class coaches
        /// </summary>
        public int? Capacity1St { get; set; }

        /// <summary>
        ///     The maximum estimated occupation load of 2nd class coaches
        /// </summary>
        public int? Capacity2St { get; set; }

        public override string ToString()
        {
            return
                string.Format(
                    "From: {0}, To: {1}, Duration: {2}, Service: {3}, Products: {4}, Capacity1St: {5}, Capacity2St: {6}",
                    this.From, this.To, this.Duration, this.Service, this.Products, this.Capacity1St, this.Capacity2St);
        }
    }
}